home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_exitcomplex_wpnts.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  174 lines

  1. # Jones 3D Cog Script
  2. #
  3. # sol_ExitComplex_Wpnts.cog   
  4. #
  5. # [SCHOLL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message    startup
  13. message user0
  14. message    aievent
  15.  
  16. thing    t_Indy        local
  17.  
  18. int        n_Waypoint        local
  19. int        n_idx            local
  20. int        b_WpntsActive=0    local
  21.  
  22.  
  23. template    tpl_mauser=khaki_mauser            local
  24. template    tpl_simonov=khaki_simonov        local
  25.  
  26.  
  27. # ===========================WAYPOINTS================================================
  28. int            NUM_WAYPOINTS=21            local
  29. thing        t_Waypoint00
  30. thing        t_Waypoint01
  31. thing        t_Waypoint02
  32. thing        t_Waypoint03
  33. thing        t_Waypoint04
  34. thing        t_Waypoint05
  35. thing        t_Waypoint06
  36. thing        t_Waypoint07
  37. thing        t_Waypoint08
  38. thing        t_Waypoint09
  39. thing        t_Waypoint10
  40. thing        t_Waypoint11
  41. thing        t_Waypoint12
  42. thing        t_Waypoint13
  43. thing        t_Waypoint14
  44. thing        t_Waypoint15
  45. thing        t_Waypoint16
  46. thing        t_Waypoint17
  47. thing        t_Waypoint18
  48. thing        t_Waypoint19
  49. thing        t_Waypoint20
  50.  
  51. thing        t_TrackMauser
  52. thing        t_Grenade
  53. thing        t_BarrowSub
  54. thing        t_HallSub
  55. thing        t_FinalShotgun
  56.  
  57.  
  58. thing        t_Commie            local
  59.  
  60. # ===========================SECTORS================================================
  61.  
  62.  
  63. # ===========================MISC CONSTANTS================================================
  64.  
  65. flex        activatewaypoints            local
  66.  
  67. end
  68. # ========================================================================================
  69.  
  70. code
  71. startup:
  72.     call ActivateWaypoints;
  73.  
  74.     // These were just for testing
  75. //    SendMessageEx(GetSelfCog(), 27, 8, 0, 0, 0);
  76. //    SendMessageEx(GetSelfCog(), 27, 11, 1, 0, 0);
  77.  
  78.     return;
  79.  
  80.  
  81. # ========================================================================================
  82. aievent:
  83.     if (GetParam(0) == 0x100) // SITHAI_EVENTMODECHANGED
  84.     {
  85.         // acquired target visibility (SITHAI_MODETARGETVISIBLE).
  86.         if ( !BITTEST(GetParam(2), 0x400) && BITTEST(GetParam(1), 0x400))
  87.         {
  88.             // Only enable roam after they have seen Indy, so that they
  89.             // don't move from their original places before we want them to.
  90. //            DebugPrint("Roaming");
  91.             AIEnableInstinct(GetSenderRef(),"roam", 1);
  92.         }
  93.     }
  94.     return;
  95.  
  96. # ========================================================================================
  97.  
  98. // Param0 is waypoint to create commie at. 
  99. //    Use 8, 9, 10, 11. The higher numbers are closer to the final room.
  100. //  Don't create two commies at the same waypoint at the same time.
  101. // Param1 specifies which type of commie.
  102. //    0 - mauser
  103. //  1 - simonov
  104. user0:
  105.     t_Commie = -1;
  106.     if (GetParam(1) == 0)
  107.     {
  108.         t_Commie = CreateThing(tpl_mauser, t_Waypoint00[GetParam(0)]);
  109.     }
  110.     else
  111.     {
  112.         t_Commie = CreateThing(tpl_simonov, t_Waypoint00[GetParam(0)]);
  113.     }
  114.  
  115.     if (t_Commie != -1)
  116.     {
  117. //        Print("Creating Commie");
  118.         AISetInstinctWpntMode(t_Commie);
  119.         AIWpntHuntTarget(t_Commie, 2.0, 0.0);
  120.         AIEnableInstinct(t_Commie, "roam", 1);
  121.     }
  122.  
  123.     return;
  124.  
  125.  
  126. # ========================================================================================
  127. ActivateWaypoints:
  128.  
  129. #    DebugPrint("ACTIVATING WAYPOINTS FOR EXIT COMPLEX");
  130.  
  131.     CaptureThing(t_TrackMauser);
  132.     AISetInstinctWpntMode(t_TrackMauser);
  133.     #CaptureThing(t_Grenade);
  134.     #AISetInstinctWpntMode(t_Grenade);
  135.     CaptureThing(t_BarrowSub);
  136.     AISetInstinctWpntMode(t_BarrowSub);
  137.     CaptureThing(t_HallSub);
  138.     AISetInstinctWpntMode(t_HallSub);
  139.     CaptureThing(t_FinalShotgun);
  140.     AISetInstinctWpntMode(t_FinalShotgun);
  141.  
  142.     for ( n_idx = 0; n_idx < NUM_WAYPOINTS; n_idx = n_idx + 1 )
  143.     {
  144.         AISetWpnt(t_Waypoint00[n_idx], n_idx);
  145.     }
  146.  
  147.     AIConnectWpnts(0, 1);
  148.     AIConnectWpnts(1, 2);
  149.     AIConnectWpnts(2, 3);
  150.     AIConnectWpnts(3, 4);
  151.     AIConnectWpnts(4, 5);
  152.     AIConnectWpnts(4, 6);
  153.     AIConnectWpnts(6, 7);
  154.  
  155.     AIConnectWpnts(8, 9);
  156.     AIConnectWpnts(9, 10);
  157.     AIConnectWpnts(10, 11);
  158.     AIConnectWpnts(11, 12);
  159.     AIConnectWpnts(12, 13);
  160.     AIConnectWpnts(13, 14);
  161.     AIConnectWpnts(14, 15);
  162.     AIConnectWpnts(14, 20);
  163.     AIConnectWpnts(15, 16);
  164.     AIConnectWpnts(16, 17);
  165.     AIConnectWpnts(17, 18);
  166.     AIConnectWpnts(18, 19);
  167.     AIConnectWpnts(19, 20);
  168.  
  169.     return;
  170.  
  171.  
  172. end
  173.  
  174.